<%@ page contentType="text/html;charset=UTF-8" %>
<html>
<head>
    <title>显示结果</title>
</head>
<body>
<form action="test_question.jsp" method="post">
        <%
	request.setCharacterEncoding("UTF-8");
	String Num=request.getParameter("nums");
	String str1=request.getParameter("str1");
	session.setAttribute("str1",str1);
	String str2=request.getParameter("str2");
	session.setAttribute("str2",str2);
	String str3=request.getParameter("str3");
	session.setAttribute("str3",str3);
	String str4=request.getParameter("str4");
	session.setAttribute("str4",str4);
	String str5=request.getParameter("str5");
	session.setAttribute("str5",str5);




%>
    您的考号是:<%=Num %><br>
    单项选择题（每题20分）<br>
    <br>

        <%request.setAttribute("user","admain");
                out.println("第一题:");%>
            <br>
                <%
                out.print("您输入的答案是:  " + str1);%>
            <br>
                <%
                out.print("错误答案是: "+"B C D");%>
            <br>
                <%
                out.print("正确答案是: "+"A");
                %>
            <br>
            <br>
        <%request.setAttribute("user","admain");
                out.println("第二题:");%>
            <br>
                <%
                out.print("您输入的答案是:  " + str2);%>
            <br>
                <%
                out.print("错误答案是: "+"B C D");%>
            <br>
                <%
                out.print("正确答案是: "+"A");
                %>
            <br>
            <br>
        <%request.setAttribute("user","admain");
                out.println("第三题:");%>
            <br>
                <%
                out.print("您输入的答案是:  " + str3);%>
            <br>
                <%
                out.print("错误答案是: "+"B C D ");%>
            <br>
                <%
                out.print("正确答案是: "+"A ");
                                                    %>
            <br>
            <br>
        <%request.setAttribute("user","admain");
                out.println("第四题:");%>
            <br>
                <%
                out.print("您输入的答案是:  " + str4);%>
            <br>
                <%
                out.print("错误答案是: "+" B C D ");%>
            <br>
                <%
                out.print("正确答案是: "+" A ");
                                                    %>
            <br>
            <br>
        <%request.setAttribute("user","admain");
                out.println("第五题:");%>
            <br>
                <%
                out.print("您输入的答案是:  " + str5 );%>
            <br>
            <%
                out.print("错误答案是: "+" B C D ");%>
            <br>
                <%
                out.print("正确答案是: "+" A ");
                                                    %>

            <br>
            <br>
            <%
                int grade = 0;
                if(str1 != null && str1.equals("A")){
                	grade+=20;
                }
                if(str2 != null && str2.equals("A")){
                	grade+=20;
                }
                if(str3 != null && str3.equals("A")){
                	grade+=20;
                }
                if(str4 != null && str4.equals("A")){
                	grade+=20;
                }
                if(str5 != null && str5.equals("A")){
                	grade+=20;
                }
            %>




            <table>
                <p>您的成绩公布如下:</p>
                <tr style="text-align:center;">
                    <td style="border:1px solid #104E8B;">考号 </td>
                    <td style="border:1px solid #104E8B;">成绩 </td>
                </tr>
                <tr style="border:1px solid;text-align: center;">
                    <td style="border:1px solid #104E8B;"><%=Num %></td>
                    <td style="border:1px solid #104E8B;"><%=grade +" 分"%></td>
                </tr>

            </table>

<br>
            <a href="welcome.html">确认</a>

    <a href="test_question.jsp">重新答题</a>
</body>
</html>
